package com.lipl.base.javase.designpattern.factory.simplefactroy;

public class Factory {

    /**
     * 根据生产类型生产对应的产品
     * @param type
     * @return
     */
    public static Product createProduct(String type){

        Product product =null;


        switch (type){

            case "A":

                product = new ProductA();
                break;
            case "B":
                product = new ProductB();

                break;
            case "C":
                product = new ProductC();

                break;


        }
        return product;
        
    }

}